package com.dongdong.controller;

import com.dongdong.model.TbAdmin;
import com.dongdong.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private AdminService adminService;

    @GetMapping("/getAdminByName")
    public TbAdmin getAdminByName(@RequestParam String username){
        return adminService.getAdminByName(username);
    }
}
